<?php 
$user=$session->read('User');
$companyid=$session->read("companyid");
$userid=base64_encode($user["id"]);
$cid=base64_encode($companyid);
//$isflag=$action->checkPermissions($user,$companyid);
?>
<div class="right_side_operate_area">
	<div class="right_side_title left">
		<h2><?php echo $form->value('Company.company_name');?></h2>
	</div>
	<div class="clear"></div>
</div>
<div class="right_side_scollbar">
    <div class="detail_info_panel_summary">
    	<div class="detail_info_panel_title">基本信息</div>
         <div class="details_item_line">
             <div class="details_item_summary">
                <div class="form_left_title left">企业Logo：</div>
                <div class="form_right_input left">
                <?php 
                $logoimg=$logo["file_path"];
                if($logoimg){
                	
                ?>	
                <img alt="" src="../../showthumbnail.php?path=<?php echo base64_encode($logoimg);?>" style="width:200px; height:80px;" />
                <?php 	
                } else {
	                echo "暂无图片";
                }?>
                </div>
       		</div>
       	</div>
        <div class="details_item_line">
             <div class="details_item_summary">
                <div class="form_left_title left"><?php __("Company Name")?>：</div>
                <div class="form_right_input left"><?php echo $form->value('Company.company_name');?></div>
            </div>
            <div class="details_item_summary">
                <div class="form_left_title left">企业地址：</div>
                <div class="form_right_input left"><?php echo $form->value('Company.license_address');?></div>
            </div>
        </div>
        <div class="details_item_line">
            <div class="details_item_summary">
            	 <div class="form_left_title left">所属产业：</div>
            	 <div class="form_right_add left">
                	<?php 
		            $industryidlist="";
		            if($pros_cvalues){
			            foreach($pros_cvalues as $pros_cvalue){
			            	if(!empty($pros_cvalue["cvid"])){
			            		$industryidlist.=$pros_cvalue["cvid"].',';
			            	}
			            }
		            }
		            ?>
		            <div id="pcvalueidlist" class="txthide"><?php echo $industryidlist?></div>
		            <div id="taglist" class="added_item_list left"></div>
		            <div class="add_item_btn left">
		                <div id="add_float_box" class="add_float_box" style="display:none;">
		                    <ul>
			                    <?php 
			                    $dan="'";
			                    foreach($industrys as $key=>$industry){
									echo "<li><label>";
									echo '<input type="checkbox" id="chbox'.$key.'" onclick="settxt(this,'.$dan.$industry.$dan.','.$dan."#ProjectIndustryname".$dan.','.$dan."#ProjectIndustryid".$dan.','.$dan."#taglist".$dan.')" value="'.$key.'" />'.$industry;
									echo "</label></li>";
									echo "<span id='span".$key."' class='txthide'>".$industry."</span>";
								}?> 
							</ul>
		                </div>
					</div>
                    <?php echo $form->text('Project.industryname',array('class'=>'txthide','readonly'=>'true','style'=>'width:500px'));?>
		            <?php echo $form->text('Project.industryid',array('class'=>'txthide'));?>
                </div>
            </div>
        </div>
        <div class="details_item_line">
            <div class="details_item_summary">
            	 <div class="form_left_title left">企业类型：</div>
            	 <div class="form_right_add left">
                	<?php 
		            $ctypeidlist="";
		            if($companytypes){
			            foreach($companytypes as $companytype){
			            	if(!empty($companytype["cvid"])){
			            		$ctypeidlist.=$companytype["cvid"].',';
			            	}
			            }
		            }
		            ?>
		            <div id="comptypeidlist" class="txthide"><?php echo $ctypeidlist?></div>
		            <div id="taglistct" class="added_item_list left"></div>
		            <div class="add_item_btn left">
		                <div id="add_float_boxct" class="add_float_box" style="display:none;">
		                    <ul>
			                    <?php 
			                    $dan="'";
			                    foreach($ctypes as $key=>$ctype){
									echo "<li><label>";
									echo '<input type="checkbox" id="chbox'.$key.'" onclick="settxt(this,'.$dan.$ctype.$dan.','.$dan."#ProjectCompanytypename".$dan.','.$dan."#ProjectCompanytypeid".$dan.','.$dan."#taglistct".$dan.')" value="'.$key.'" />'.$ctype;
									echo "</label></li>";
									echo "<span id='span".$key."' class='txthide'>".$ctype."</span>";
								}?> 
							</ul>
		                </div>
					</div>
                    <?php echo $form->text('Project.companytypename',array('class'=>'txthide','readonly'=>'true','style'=>'width:500px'));?>
		            <?php echo $form->text('Project.companytypeid',array('class'=>'txthide'));?>
                </div>
            </div>
        </div>
       	<!-- 信息来源 开始 -->
        <div class="details_item_line">
            <div class="details_item_summary">
            	 <div class="form_left_title left">信息来源：</div>
            	 <div class="form_right_add left">
                	<?php 
		            $informationlist="";
		            if($informationfroms){
			            foreach($informationfroms as $informationfrom){
			            	if(!empty($informationfrom["cvid"])){
			            		$informationlist.=$informationfrom["cvid"].',';
			            	}
			            }
		            }
		            ?>
		            <div id="informationfromidlist" class="txthide"><?php echo $informationlist?></div>
		            <?php //debug($informationfroms);?>
                	<div id="taglistctim" class="added_item_list left"></div>
                    <div class="add_item_btn left">
		                <div id="add_float_boxct" class="add_float_box" style="display:none;">
		                    <ul>
			                    <?php 
			                    $dan="'";
			                    foreach($informations as $key=>$information){
									echo "<li><label>";
									echo '<input type="checkbox" id="chbox'.$key.'" onclick="settxt(this,'.$dan.$information.$dan.','.$dan."#ProjectInformationfromname".$dan.','.$dan."#ProjectInformationfromid".$dan.','.$dan."#taglistctim".$dan.')" value="'.$key.'" />'.$information;
									echo "</label></li>";
									echo "<span id='span".$key."' class='txthide'>".$information."</span>";
								}?> 
							</ul>
		                </div>
					</div>
                    <?php echo $form->text('Project.informationfromname',array('class'=>'txthide','readonly'=>'true','style'=>'width:500px'));?>
		            <?php echo $form->text('Project.informationfromid',array('class'=>'txthide'));?>
                </div>
            </div>
        </div>
        
        <!-- 信息来源 结束-->
        <div class="details_item_line">
            <div class="details_item_summary">
                <div class="form_left_title left"><?php __("Regedit Time")?>：</div>
                <div class="form_right_input left"><?php echo $form->value('Company.reg_time');?></div>
            </div>
            <div class="details_item_summary">
                <div class="form_left_title left"><?php __("Regedit Capital")?><span class="captype">(万)</span>：</div>
                <div class="form_right_input left">
	                <?php echo $form->value('Company.cap_type')=="0"?"￥":"＄"?>
	                <?php echo $form->value('Company.capital');?>
                </div>
            </div>
        </div>
        <div class="details_item_line">
            <div class="details_item_summary">
                <div class="form_left_title left">入驻时间：</div>
                <div class="form_right_input left"><?php echo $form->value('Company.resident_time');?></div>
            </div>
            <div class="details_item_summary">
                <div class="form_left_title left">职工数量：</div>
                <div class="form_right_input left"><?php echo $form->value('Company.workers');?></div>
            </div>
        </div>
        <div class="details_item_line">
            <div class="details_item_summary">
                <div class="form_left_title left">企业负责人：</div>
                <div class="form_right_input left"><?php echo $form->value('Company.contact');?></div>
            </div>
            <div class="details_item_summary">
                <div class="form_left_title left"><?php __("Tel")?>：</div>
                <div class="form_right_input left"><?php echo $form->value('Company.tel')==0?"":$form->value('Company.tel');?></div>
            </div>
        </div>
        <!-- 负责人邮箱 -->
        <div class="details_item_line">
             <div class="details_item_summary">
                <div class="form_left_title left"><?php __("Mail")?>：</div>
                <div class="form_right_input left"><?php echo $form->value('Company.email');?></div>
            </div>        
        </div>
        <div class="details_item_line">
            <div class="details_item_summary">
                <div class="form_left_title left">常用联系人：</div>
                <div class="form_right_input left"><?php echo $form->value('Company.usualcontact');?></div>
            </div>
            <div class="details_item_summary">
                <div class="form_left_title left"><?php __("Tel")?>：</div>
                <div class="form_right_input left"><?php echo $form->value('Company.usualtel')==0?"":$form->value('Company.usualtel');?></div>
            </div>
        </div>
        <div class="details_item_line">
             <div class="details_item_summary">
                <div class="form_left_title left"><?php __("Mail")?>：</div>
                <div class="form_right_input left"><?php echo $form->value('Company.usualemail');?></div>
            </div>        
        </div>
        <div class="details_item_line">
            <div class="details_item_summary">
                <div class="form_left_title left">法人身份证号：</div>
                <div class="form_right_input left"><?php echo $form->value('Company.corporation_ID');?></div>
            </div>
            <div class="details_item_summary">
                <div class="form_left_title left">法人护照号：</div>
                <div class="form_right_input left"><?php echo $form->value('Company.passportNo');?></div>
            </div>
        </div>
     </div>
     <div class="detail_info_panel_summary">
     	<div class="detail_info_panel_title">经济总收入（单位：万元）</div>
     	<?php 
     		for($m=0;$m<12;$m++){
//     			foreach ($compeconomic as $e){
					$month = $m+1;
     				if($month == $compeconomic[$m]['CompEconomic']['month']){
     					echo "<div class='detail_ecnomic_block left'><div class='detail_ecnomic_m left'>".$month."月份：</div>".$compeconomic[$m]['CompEconomic']['general_income']."</div>";
     				}else{
     					echo "<div class='detail_ecnomic_block left'><div class='detail_ecnomic_m left'>".$month."月份：</div>暂无</div>";
     				}
//     			}
     		}
     	?>
     </div>
      <div class="detail_info_panel_summary">
      		<div class="detail_info_panel_title">人才信息</div>
      		<div class="right_sidt_head_screen">
		<div class="right_side_head_line">
		<!-- 
		<ul>
				<li>
					<div class="left screen_condition"><?php echo $html->link("总人数","/companys/person")?>：</div>
					<div class="left screen_counts"><?php echo $personcount?>人</div>
					<div class="clear"></div>
				</li>
				<?php 
				foreach($educationcount as $education){
					$selected="";
					if(!empty($_GET['education'])){
						if($education["key"]==$_GET['education']){
							$selected="selected";
						}
					}	
				?>
				<li class="<?php echo $selected?>">
					<?php if($education["key"] == "2" || $education["key"] == "3"){
					?> -->
							<!--<div class="left screen_condition"><?php echo $html->link($education["name"],"/companys/person?education=".$education["key"])?>：</div>
							<div class="left screen_counts"><?php echo $education["count"]?>人</div>-->
					<!--<?php 
						 }
						 else if($education["key"] == "1")
						 {
					 ?>
						 	<div class="left screen_condition"><?php echo $html->link($education["name"],"/companys/person?education=".$education["key"])?>：</div>
							<div class="left screen_counts"><?php echo $postgradutate_count?>人</div>
					<?php }  
						 else
						 {
					?>
							<div class="left screen_condition"><?php echo $html->link($education["name"],"/companys/person?education=".$education["key"])?>：</div>
							<div class="left screen_counts"><?php echo $education["count"]?>人</div>
					<?php }?>
					<div class="clear"></div>
				</li>
				<?php }?>
				<div class="clear"></div>
			</ul>
		
		 -->
		
		
					<ul>
<?php 
	if (!empty($persontypes)){
		if (!is_array($persontypes)){//如果数据不为数组，则把它拼为数组
			$persontypes[] = $persontypes;
		}

		foreach ($persontypes as $key=>$value){
			if (!empty($key)){
				$showPNvalue = array();
				if (is_array($personnums)){//至少有两条记录
					foreach ($personnums as $personnum){
						if ($personnum['CompPersonNum']['type_id'] == $key){
							$showPNvalue = $personnum['CompPersonNum'];
						}
					}
				}else{//只有一条记录
					if ($personnums['CompPersonNum']['type_id'] == $key){
						$showPNvalue = $personnums['CompPersonNum'];
					}
				}
?>
				<li>
					<div class="left screen_condition"><?php echo $value;?>：</div>
					<div class="left screen_counts"><?php echo empty($showPNvalue['number'])?0:$showPNvalue['number'];?>人</div>
					<div class="clear"></div>
				</li>
<?php			
			}
		}
	}    		
?>				
			</ul>
		</div>
		<!--  div class="right_side_head_line">
			<ul>
				<?php foreach($persontypecount as $persontype){
					$selected="";
					if(!empty($_GET['persontype'])){
						if($persontype["key"]==$_GET['persontype']){
							$selected="selected";
						}
					}	
				?>
				<li class="<?php echo $selected?>">
					<div class="left screen_condition"><?php echo $html->link($persontype["name"],"/companys/person?persontype=".$persontype["key"])?>：</div>
					<div class="left screen_counts"><?php echo $persontype["count"]?>人</div>
					<div class="clear"></div>
				</li>
				<?php }?>
				<div class="clear"></div>
			</ul>
		</div-->
	</div>
     </div>
      <div class="detail_info_panel_summary">
      		<div class="detail_info_panel_title">知识产权情况</div>
      		 <div class="right_sidt_head_screen">
    	<div class="left">
		 
			<div class="right_side_head_line">
				<ul>
					<?php foreach($patenttype as $statekey=>$patype){
						$indexstr=$str->getstausstr($statekey);
					?>
					<li style="margin:auto;width:auto">
						<div class="left screen_condition"><?php echo $indexstr?>：</div>
					</li>
					
						<!-- 显示每种状态的四种专利类型 start -->
						<?php 
						
							foreach($patype as $key=>$ptype){
								$selected="";
								if(isset($_GET['state']) && isset($_GET['ptype'])){
									if($statekey == $_GET['state'] &&  $key==$_GET['ptype'] ){
										$selected="selected";
									}
								}	
						?>
						<li class="<?php echo $selected?>" style="width:auto;margin-right:20px;">
							<div class="left screen_condition"><?php echo $html->link($patentname[$key],"/companys/patents?state=$statekey&ptype=".$key)?>：</div>
							<div class="left screen_counts"><?php echo $ptype;?>个</div>
							<div class="clear"></div>
						</li>
						<?php }?>
						<div class="clear"></div>
						<!-- 显示每种状态的四种专利类型 end -->
						
					<?php }?>
					<div class="clear"></div>
				</ul>
			</div>
			
		</div>
		<div class="clear"></div>
	</div>
     </div>
</div>
<?php echo $javascript->link('project.js');?>